error in if statement