Fixed writing content to output