app: added internal error handler