Wrap connection clean-up in finally block

I don't really understand how this could have worked before, outside of the finally block, when it now requires placing inside it...