Bug fix

Fixed a bug where the database would add duplicate transactions.