fix pgdir issue in heap