stdin support added