Changed InvalidArgumentException to IllegalArgumentException