Added connection functionality.