fixed bug on flips