fix sorting