fixed the flipflop