Nest this in a try/finally to make sure the dependencies get closed.