fixed exception check in test.