Adding simple error handler.