Fixed bug with replacing old connections with new ones