fixed a mem leak