updated type validation