This should probably be in a function outside of the plugin if you want it in the try, which I think is a good idea.