Changed connection in main to unique_ptr
connection now has a destructor