fix sorting compare