Update #283 - Fixed issue where connection could be opened/closed multiple times