account for socket closures