Implemented memory freeing while deleting VirtualMachine