fixed Parse error: syntax error, unexpected 'if'