Bugfix for shutdown all tasks