Improved home page autocollapse functionality