fix shadowed variable issue