call collapseHeight when needed