Fix bug  when open new window