How can I close popup window automatically when I close the parent window (the application itself)? Thanks.