resource cache. fixing minor bugs