Added code to remedy situation of no connection.