bug fix: dont set handlerIndex until presence of handlers array is confirmed