Added option to set attributes when creating multiple instances