Added some error detection for vm lookups
Added some error handling for vm lookups