fixed "server runs away" problem in non-MDI mode