Adding error handling logic for tokens without the 'card' attribute