Fix sync process by @matiu