fix a mem leak