Issue #174 - Modify to handle loosing the connection