changed cache logic