made the fix work for both LuaJIT and vanilla lua