Bug fix : Handle socket.error exception