added a log statement to know exactly where output data is written