changed vm creating method