Effects of mass death on community structure and ecosystem function