fix heap length