trying to fix freeing the buff