fix debug behavior
add dump function
fix typo