close upstream sock earlier; fix refresh