sustain associated objects when assigning attributes
fix wrong variable name