MIN function returning 0 instead of correct value on form