fix bug in sorting by attendance