add last documents history and fix wtest.lua