fixed mutex lock bug