add type attr & validation