avoid multiple initializations of loop variable