fixed a undefined index bug

FIXED #71