avoid a double free