Fix readLine function