Your way seems to be working correctly but I will have to do better experiments tomorrow using various computers/hardware setup to make sure. Lots more tests to do. Below is how I added line to main.C.