added active record validation and assosciations