add isValid Method