fix for race condition in writing roi specification file