update cache functionality