added a footer and fixed duplicate saves