fix for executing callback unnecessarily multiple times when no results are returned from index