Fix syntax error on if statement