fixed 2 error warnings on undefined index and variable