added ORDER BY for race queries