add report preview and fix some bugs