Making sure the correct alias is selected for pagination sorting