history bug fix that deleted already deleted segments