fix trace code