Updated text handling to better accommodate for special characters