fixed an undefined index notice