fixed illegal flips