fix a bug in mutex