server termination fixes