closing window updates location.json with default location and port