fix bug when deploying a VM.