trim history file