add  lock and unlock function