make 'tag' variable local, too