fixed collapse bug