If you're reviewing this code, please take a moment to consider the implications of this static caching, which eliminates a delay (~3 seconds) on subsequent calls, but could have security implications. I assume that caching the resource handle alone is not an issue, but a sanity check on your part would be reassuring.