Prevent infinite loop while moving bookmarks and folders