made the read with options and repeat
made pipe read and open, doesnt work exactly fine