Group by entity ID to prevent duplication.
Merge pull request #32 from Gizra/prevent-duplicates

Group by entity ID to prevent duplication