add function to loop test the function