add Chat window and window close function