Fix upsert in grub function