moved cleanText out of if