attempt to fix mem leak