Close any existing connection before establishing new connection