fix more external resource logic