fix array_search checking