Added collapse state saving