Fixed lock issue