replaced str() calls with unicode()