fixed long text infinite loop