Conditionally hidden fields are not working correctly on the form