Fixed crash after an exception was caught