sandbox mode is now threadlocal variable; prevent infinit loop