fix race condition with mutex