fixed the value of the argument to be heap index and not cpu index