more socket error handling