Removed shutdown race condition