updating error handling