Memory issue almost solved