added savehistoryassync method