replaces unicode with str for Python 3 support