due to changes in attributerecord this had to be adapted