code fix to correctly get at related object's fields dynamically.