fiexed "/undefined/index" error