add stdin support