replacing deprecated approach of get_index()

Since 2.0, haystack.site is removed and this patch uses the current way haystack grabs the index #6