updated error handler, made classes non-static (must always now be instantiated before use).