save history in thread