removed console output from writer function