Yap ,
thats simple !

You specified the Redirectoutput within your loop

Just place the function call outside any loop and Bob's your uncle

hth
_________________________