fix check for stdin