added no-connection logic