Added thread pool await shutdown

Thread pool shutdown after all tasks completed