added support to pipe stdin