Adding mutexes. Doesn't work yet