update cache logic but not finished