shouldn't this be `if self.memstore is not None:`? I'm not sure about the values of the memstore.