fix problem when resizing widget