uses now exceptions for error handling