LUA Scripting - When to check session readiness?