fix collapse bug