resolve #80 Add support for debug mode