fix basestring in python 3