Adding check for basestring