Replace unicode with str method to support Python 3