fix search invalid argument by empty array