Add history saving