second fix to heapq