adapting for future versions of LuaTeX