Conditions in form work incorrectly