add profiling hooks