BZ-10486 added dynamic sizing --> merge from trunk