fix for duplicate join table entries