finished the expceiton handling