added custom default error handler