improve sort behaviour