save history data in separate tables