Adding state loop