shouldn't this be inside the `if ($dropdownItem) { ... }` ?