Fix PHP Notice:  Undefined offset: 0