When `$additional_search_parms` got initialised as an array, you can just do the for each.
So remove this if