resolved a locking bug in sync