change heap to getHeap()