reduce the possibility of race conditions when using the lock utility