fixed bug when there is no trace