fixed the ungracefull crash on gibberish data, now nicely throwing exceptions and NOT breaking loops