Move Tom script call to the right place
Correct name of environment variable for device