change cyclicMaster cycle detection alg (had not reset loop counter)