updated error handling methods