still working on memory issue