[added] define and set attributes in constructor