wtf , error in the use of the variable i.
thank you very much friends, it works perfectly.