Prevent double insert database error. Fixes #49.
Merge pull request #51 from pinittome/issue-49

Prevent double insert database error. Fixes #49.