Adapted to new XPM version