Trying to handle for multiple threads
Tested with LuaJIT - excellent