Fixes 'Creating default object from empty value' error

$myQuery wasn't defined previously, $countQuery was.