add flags.
add some Debug info.