Fixing issues with database and event type