adding the sorting functionality on field