fixed dataset sorting