Fixed local variable issue