Fixed index out of range in web view hook