Condition in form is not working as expected.