Correcting collapse list function