Fix records duplicates in db