I think we should use a local variable instead using member variable in a loop.