updated with latest jaime changes + error handling when no h_vmem