fixed to reject duplicates in insert