fix bug with collapsing breaking