add lock and unlock and mutex