updates to correct previous commit which essentially excluded the connection error check