fix some mem leak