Adding validation for insert