added repeat state toggling