fix bug, when you use more than one $i