fix graceful stop behaviour by using thread executor the correct way