Fix bug for deleting history from previous patch