remove dead code from isValid method