fixed a mem error when flipping the text