add a memento support to save restore objects