type validation