fix issue with reuse of variable name