Misplaced ) in if statement