implement quit command properly