hopefully fixed the sync bug in the buffer