Added codes to remove all history being recorded during working