added check for if argument is string or series object.