catches exception for syntaxt errors