check for instance of basestring instead of string