Added connect method including an initial ping