Fixed connection function