added index and unique key