Fixbug on auto collapse