added raii class to profiler