adjusted sync script