Undefined index fix @Joss