fix bug with array_search