fix Lua stack overflow