changed the way it checks whether to update cache