refactor lock  and update readme