added profiling of queries in application to debug