fix widget handling and layout