We might want to have this method protect itself against race conditions with a mutex.