added error handler; added test for expressions