Changed data.entry_insert to upsert if entry already exists