fixed bug with sorting of widgets