fix mutex after code review