fix some bugs and add test page