Fixed problem with shutting down async tasks