I made the changes you mentioned for line 527 with the code below , but now i get a new error that the itemID is not correct
527 : entity.surface.spill_item_stack({position = entity.position, stack = { name = name, count = count }, force = entity.force})
The scenario level caused a non-recoverable error.
Please report this error to the scenario author.
Error while running event level::on_player_cursor_stack_changed (ID 37)
Invalid ItemID: expected LuaItemPrototype, LuaItemStack, LuaItem or string.
stack traceback:
[C]: in function 'spill_item_stack'
level/control.lua:527: in function <level/control.lua:496>