Added exception class and handlers