There are brackets missing:

    $nids = $query->execute();