add simple exception handling