basic error checking, so non syntax errors can be caught, and execution can end after parsing, without crashing