replaced str with basestring in previous fix