remove unnecessary expand function in text modes