fix typos and debug