fix flipping