try to make socket more robust