added basic structure to exception handling