check against basestring rather than str