made change to mutex as suggest by #8