fix sorting, with interesting export requirement