add handling of socket errors