Set attributes. fix #218