fixed a concurrency bug in the vm