maybe a fix to catch the socket error?