Updates the connection function.