fix lock issue
in middle