updated error message processing