added field and fixed sort