index error fixed in StemLoop