put cache reset into a callable function