Fixes 500 error on ajax requests for count without query_id