Add an exception handling