expand exceptions and error handling