changed the way to handle syntax errors