some minor cleanup
add debug