fix some possible memory leap points.