modefied lgCmdFuncTrace(), and fixed some bugs