Replace try: except AttributeError: