add edit clause to switch