adapted to new xforms