add save_with_history to manage history feature