bug fix and more output messages