Fixed the looping order so it now exports to clipboard correctly