Fixed undefined index . #1270