Fixed sorting error