updated example file to include usage of .isValid()