Fix bug with syncing directories