Caught potential resource leak