added validation and relationships