Actually fix issue #1, previous fix did not save history correctly