fix vm hang on shutdown