During handling of the above exception, another exception occurred

Old code:

New code: