Fixed write out of exceptions

Writing exceptions to commandline had a problem which repeated the whole text multiple times - fixed this issue