modify buffer reading