add loop flag back.