fix destroy vm function