example enhanced updated with delay for stdout file creation