replace getattr with descriptor