fix issue with trigger causing duplicates