add set/get attribute

We could also add this to 2.1 branch, since it LTS and on support for 1.5 year