fixed bug in ordering of selected items when using "Select all" buttons