added accepts_nexted_attributes_for and updated controller