fix more infinite logic