Minor changes in conditional loop for create vm