modified to work profiler.