modify searchByIndex

catch error while the first index argument is not available, then return
none