fixed a major scoping bug in the vm's