close the connection properly (mis-transplanted variable)