fix an issue that eating memory