undefined index notices resolved