Not right sorting logic