Check if BufferedReader is ready before reading

There was an issue when running commandline with the profile option and reading from stdin