ticket:10 created sorting logic