added connect and retrieve ATR function