fixed premature closure of server