fix double free in debug