fixing TypeError, close #12285
moving tooltipbox up to the front
Merge pull request #2518 from aleksandra-tarkowska/fixing_for_loop

fixing TypeError, ticket #12285