Hiding fields based on conditions not working