Fixed to use getattr.