toggling between show and edit states