add tests / fix attr method