change getCount() and isvalid() for update unique field