checks for syntax errors