fix the mutex scope and some typos