Fix flipping issue