fix a race condition in the mapper, #87