fixed syntax errors handling