Fixed #277 - Prevent sync concurrency

Why these changes?