fixed mutex bug