pass the upload test, and fix some sync logic