better mutex management