fix panic when killing task