server closes and opens