bug fixed for mutex