Add error handle on index