corrected collapse/expand bugs