3: add exception handling