Fix sorting issue

TNL-952
@Shrhawk , sorry, I meant add a comment in the code