added clear cache logic