changing exception type to IllegalArgumentException