modify loop flag.