Just a hint as this lead to crashes in the past (maybe it is not necessary anymore today as the code got changed?):
Inside your callback function of the row, after the original callback function was executed, check if the inventory updte was executed because a horse got changed and your bagsize changed this way:
Lua Code:
--Do not execute if horse is changed
if SCENE_MANAGER:GetCurrentScene() ~= STABLES_SCENE then
-- do your stuff
end
In the past, if you didn't check for the horse stuff, the game crashed some times. But this maybe old and not needed anymore? Maybe circonian knows as his code is not using it.