Added some exception support