Fixing a bug with deleting file/directory during sync process