fix more error catching