Fixed error with unset index