automatically update content if output file is opened, fixed indentation