Modify to return self.getline() value when exit