fix the bug of heapLocals