diff --git a/ai-simplesitestats.php b/ai-simplesitestats.php
index b705d37a0a482dae9ce44bf8d41013351788c9ce..744506766ead7984cfc2d858c7d9a945c8c35230 100644
--- a/ai-simplesitestats.php
+++ b/ai-simplesitestats.php
@@ -82,7 +82,7 @@ class StatisticsPage {
         echo '<div>';
         echo '<label for="'. $name . '_field">' . $label . '</label>';
         echo '<select name="' . $name . '" id="' . $name . '_field">';
-        for ($i = 0; $i < len($choices); $i++) {
+        for ($i = 0; $i < count($choices); $i++) {
             echo '<option value="' . $choices[$i] . '"';
             if ($choices[$i] === $value) {
                 echo ' selected';