adding active record callbacks