Added exception control