I can certainly add a try/finally

This code is more or less stolen from prad's, so don't judge me :see_no_evil: