This way stuff get's reported to the caller. Ps: Why 2 and not 3? Replace "return waitForResponse(id)" by "local x=waitForResponse(id) return x" below and the right choice is 3!! There's some weird tail-cat recursion Lua function rules going on here...