fix race condition when stopping server