fixing connection callbacks issues