add attribute if it doesn't already exist (fixes #38)