modified to reuse server