minimal revert of the double delete introduced by 10a2578

fix for #1849