added support for profiling