null check on shutdown