fix read loop
nicer print