use getattr instead of __dict__ in rereference