add control of prefix output
add crash test