Added an exception around the code.