fix small bug in priority queue