add unique indexes
change old function call