improve error handling in the socketIO->read() method