Adding functionality to update cache when deleting a segment