adding logic to vm initialization