changed where to store in mem