Fixed loop problem