lock/unlock around printing missing unit IDs