fixed the text reversal problem