Fixed a few things with the connection function