Fixed bug. It sets the connection object correctly