Adds type validation