Added and modified the isModified and validAndUpdate functions