fix heap structure