Conditional logic to hide/show fields is not working