put VM_NAME out of the functions and set it globally