Added validation and changes to schema