fixing undefined index notice