fix more bad bugs around caching and db reads