fix lock refactor