fixing connection code
fixing connection code