agent, write, finally