Fix repeat condition

condition was backwards