Fixed the text output method