fixed bug for piping Bam to stdin