Renamed memory storage and added locking