fix some bugs in get_vm()