removed ORDER BY for count(*) query which caused an error