implemented a method to prepareAttributes before to persisted It