fix syntax error, and checking statement