Release connection before returning