fix sorting data