added an else statement for connection success