sort bugfix