Fixed sorting issue