Use array for error handling