debug statements to track down "Undefined index" notice