Fixed an error when running sync