small bug fix, cannot call mutex_unlock without calling mutex_lock first