ensure sorting