profiling and logging added