fix exception rethrow code