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

fixing TypeError, ticket #12285 (rebased onto dev_5_0)