ensures the connection is returned back to the pool when completed