Debugging threading functionality for better preformance