fix profiling bug