modified for Xen support