invert method for text type