updated error handler

update error handler