updating history and todo