Add getAttr hook, which is called when attribute is fetched