Add sorting functionality on UI.