swithed the throws for an array with the error message