updated error message passing