fixed error on logout

closes #23
refactoring for new LuaCore compatibility