fixed profiling routine