added some optimazition for vm