fix more crash bugs