made tests more robust for exceptions