fix bad loop var