use thread to sync files