Fix collapsing bug