changing getconnection to setconnection