Fixed undefined index error.