Added mutex to map access. Its the responsible thing to do :/. Closes #9