reading by 1 byte is a bad solution