just change the wend by next

i think that'll make the trick