Conditions to hide fields not working