fixed memory problem
fixed memory issues