add magic setter for attributes