change to use index and primary and unique