update main class: add exceptions