fix ifs for fields to make undefined index error go away i hope