fixed memory crash