Fixes bug where new events would be entered into the database twice.