Implemented the NetworkManager connect func