fixed and improved on mutex