Fix syntax error in if statement