try to bail out on socket errors