Fixing problem with undefined fields

I have no idea why it was working before but this is my approach...