Added connection code