Replaced `str` with `text_type`