added test for isValid