fixed #17 by using getattribute