updated error processing