Fix collapse bug