Fixing connection errors