add scaling of attr to write method