Added open-connection function