null pointer exception from readLine() fixed