hide/show fileds based on conditions not working