Fix bug windowId is nil.