added logging to read bytes