fixed bug with sort and display