Fix undefined error properly
Last time. Properly fix undefined index error.