prevent race conditions, use a mutex for each item