change str type check to basestring