[yanan] fix undefined value of index