minor code changes for profiling