adding performance monitoring logic