Add sorting handler - WIP.