Set constraint state only when valid