Readded exception handling code, since it did not work in Base