added validation and detail view