Implemented getattribute recursively