try to fix the invalid heap error