fix handling of new connection state