fix condition for stdin and allow piping to stdout

@kevva this shld fix it i guess ? thanks for the input related to #382