fix analysis loop