fix ui problems when the available space for #content is changed