check validity on change