Fixed undefined index error in views alter function