fixing connection stuff