cleanup; output statistics to LUA module