Server stops when program exits