Added additional code for Exception Hnadling