fix bug in printing exception message