reworked receive buffer