fixed memory loss