fix some bug, and add a login wnd test