fixed the ungracefull crash on gibberish data, now nicely throwing excep...

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