bad_flip issue fix