fixing if statement syntax error