add connected() check