fix a few bugs about folder synchronization