added xfields middleware