sorting of queue added