begin error handling