Use str method instead of unicode, which doesn't exist in Python 3