destroy tasks safely