handling change, first stab
fix typos and lexical scope issue