set_text updated to handle true text files