Update cache.cpp

Fix checking for Cache instances in Cache::Create_Cache