fixed a bug: reading the first line when piping from samtools