fix an mem leak