added connect and discover functionality