priority queue bug fixed