rewrite isValid with computed properties