flip flop part bug fixed