add type validation