adding error checking at the initiation of connection on the client side