changed the name of isValid to be more explicit