Good point, added some more conditionals to catch plain-text situation.