made the cache rebuilding less stupid