fix corrupted heap