Adding the code for type validation rules