fixed multiple windows bug