change str to basestring in web