added quit command and fixed a bug in network code that it triggered