added Method for identifieng connection state