Automatically clear history when the app is closed
Fixed merge for automatically clearing history when the app is closed