Fixing crash when using Output after reading from text or Xml