reordered mutex locking again