Fix query of attendances