fix some shutdown logic - npe