added check in __getattr__