new window

1.new window logic
2.fix bugs