updated attribute setting code.