bug fix in writing to files. separate args with space