@jakesmith are there any threading issues - does this also need to be in a critical section?