added validator and sanitization mechanism