fixed exception block logic
added exception block unit-test