minor import cleanup and use finally to avoid hanging on other Exceptions