fix bugs in profiling
fix bugs