replace readline with getline