fixed memory leakage bug