please add a if for String and throw an exception otherwise.