modify trace history function