Added an exception catch.