Added monitor function for thread pool