Added delays so server closes properly