fixes #3017
Merge pull request #3022 from digi604/fix-3017

fixes #3017 (less queries in toolbar middleware)